package com.java.collection;

import java.util.LinkedHashSet;
import java.util.Set;

public class LinkedHashSetDemo {
    public static void main(String[] args) {
        Set<String> set = new LinkedHashSet<>();
        set.add("张三");
        set.add("李四");
        set.add("王五");
        set.add("赵六");
        set.remove("王五");
        System.out.println("数据个数"+set.size());
        for (String str : set){
            System.out.println("名字是："+str);
        }
        System.out.println("数据是否存在："+set.contains("张三"));
        set.remove("数据是否存在："+set.isEmpty());
    }
}
